<?php
// +----------------------------------------------------------------------
// | CatchAdmin [Just Like ～ ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~{$year} http://catchadmin.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
// you should use `$router`
/* @var think\Route $router */
$router->group('product',function () use($router) {
    // 品牌列表
    $router->post('brand/index', 'catchAdmin\product\controller\Brand@index');
    // 品牌创建
    $router->post('brand/create', 'catchAdmin\product\controller\Brand@create');
    // 品牌修改
    $router->post('brand/update', 'catchAdmin\product\controller\Brand@update');
    // 品牌删除
    $router->post('brand/delete', 'catchAdmin\product\controller\Brand@delete');
    // 供应商列表
    $router->post('supplier/index', 'catchAdmin\product\controller\Supplier@index');
    // 供应商创建
    $router->post('supplier/create', 'catchAdmin\product\controller\Supplier@create');
    // 供应商修改
    $router->post('supplier/update', 'catchAdmin\product\controller\Supplier@update');
    // 供应商删除
    $router->post('supplier/delete', 'catchAdmin\product\controller\Supplier@delete');
    // 制造商列表
    $router->post('manufacturer/index', 'catchAdmin\product\controller\Manufacturer@index');
    // 制造商创建
    $router->post('manufacturer/create', 'catchAdmin\product\controller\Manufacturer@create');
    // 制造商修改
    $router->post('manufacturer/update', 'catchAdmin\product\controller\Manufacturer@update');
    // 制造商删除
    $router->post('manufacturer/delete', 'catchAdmin\product\controller\Manufacturer@delete');
    // 单位列表
    $router->post('unit/index', 'catchAdmin\product\controller\Unit@index');
    // 单位创建
    $router->post('unit/create', 'catchAdmin\product\controller\Unit@create');
    // 单位修改
    $router->post('unit/update', 'catchAdmin\product\controller\Unit@update');
    // 单位删除
    $router->post('unit/delete', 'catchAdmin\product\controller\Unit@delete');
    // 包装列表
    $router->post('pack/index', 'catchAdmin\product\controller\Pack@index');
    // 包装创建
    $router->post('pack/create', 'catchAdmin\product\controller\Pack@create');
    // 包装修改
    $router->post('pack/update', 'catchAdmin\product\controller\Pack@update');
    // 包装删除
    $router->post('pack/delete', 'catchAdmin\product\controller\Pack@delete');
    // 包装列表
    $router->post('product/index', 'catchAdmin\product\controller\Product@index');
    // 包装创建
    $router->post('product/create', 'catchAdmin\product\controller\Product@create');
    // 包装修改
    $router->post('product/update', 'catchAdmin\product\controller\Product@update');
    // 包装删除
    $router->post('product/delete', 'catchAdmin\product\controller\Product@delete');
    //【新增】获取商品信息
    $router->get('product/detail/:serial_number$','catchAdmin\product\controller\Product@detail');
    //【新增】件数转成箱数、托数

    //$router->post('goods/category/sync$', 'catchAdmin\product\controller\Category@sync');


})->middleware('auth');
//无权限验证无分页的品牌列表
$router->rule('product/brand/getBrand', 'catchAdmin\product\controller\Brand@getBrand','POST');
//无权限验证无分页的列表
$router->rule('product/supplier/getSupplier', 'catchAdmin\product\controller\Supplier@getSupplier','POST');
//无权限验证无分页的制造商列表
$router->rule('product/manufacturer/getManufacturer', 'catchAdmin\product\controller\Manufacturer@getManufacturer','POST');
//无权限验证无分页的单位列表
$router->rule('product/unit/getUnit', 'catchAdmin\product\controller\Unit@getUnit','POST');
//无权限验证无分页的包装列表
$router->rule('product/pack/getPack', 'catchAdmin\product\controller\Pack@getPack','POST');
//无权限验证无分页的商品列表
$router->rule('product/product/getProduct', 'catchAdmin\product\controller\Product@getProduct','POST');
//无权限验证无分页的商品下的包装
$router->rule('product/product/goodsPacking', 'catchAdmin\product\controller\Product@goodsPacking','POST');
$router->rule('product/product/getGoods', 'catchAdmin\product\controller\Product@getGoods','POST');
$router->rule('product/product/getPacking', 'catchAdmin\product\controller\Product@getPacking');
$router->post('product/product/inventory', 'catchAdmin\product\controller\Product@inventory');


$router->group('houniao',function () use($router) {
    // 分类列表
    $router->get('goods/category$', 'catchAdmin\product\controller\Category@index');
    $router->delete('goods/category/:id', 'catchAdmin\product\controller\Category@delete');
    $router->get('goods/category/remote$', 'catchAdmin\product\controller\Category@remote');
    $router->post('goods/category/sync$', 'catchAdmin\product\controller\Category@sync');

    //商品
    $router->get('goods/remote$', 'catchAdmin\product\controller\Goods@remote');
    $router->get('goods', 'catchAdmin\product\controller\Goods@index');
    $router->post('goods/sync$', 'catchAdmin\product\controller\Goods@sync');

})->middleware('auth');